package com.stujyh;

public class Factory {
    public static WeaponFactory getFactory(String factory){
        if ("GunFactory".equals(factory)){
            return new GunFactory();
        } else if ("TankFactory".equals(factory)) {
            return new TankFactory();
        }else{
            throw new RuntimeException();
        }
    }
}
